const APP = 'app';
const PUBLIC = 'public';

const PATH = {
    APP: APP,
    PUBLIC: PUBLIC,
    VIEWS: 'views',
    BASE_VIEW: 'tpls/layout',
    SCRIPTS: `${PUBLIC}/scripts`,
    STYLES: `${PUBLIC}/styles`,
    VENDORS: `${PUBLIC}/vendors`,
    ICONS: `${PUBLIC}/icons`,
    IMAGES: `${PUBLIC}/images`,
    DIST_SCRIPTS: `${PUBLIC}/dist/scripts`,
    DIST_STYLES: `${PUBLIC}/dist/styles`
};

module.exports = {
    PATH: PATH,

    /**
     * integrate styles and scritps for common using.
     */
    core: {
        style: `${PATH.STYLES}/${APP}.styl`,
        script: [
            `${PATH.VENDORS}/spin.min.js`,
            `${PATH.VENDORS}/fastclick.js`,
            `${PATH.SCRIPTS}/utils/utils.js`,
            `${PATH.SCRIPTS}/utils/http.js`,
            `${PATH.SCRIPTS}/utils/loading.js`,
            `${PATH.SCRIPTS}/utils/markets.js`,
            `${PATH.SCRIPTS}/utils/Pagination.js`,
            `${PATH.SCRIPTS}/common/consts.js`,
            `${PATH.SCRIPTS}/common/wxsdk.js`,
            `${PATH.SCRIPTS}/common/common.js`
        ]
    },

    /**
     * each page is a task
     * the task name is the page name, each page may has scirpt and style
     */
    tasks: {
        'index': {
            style: `${PATH.STYLES}/index.styl`,
            script: [`${PATH.SCRIPTS}/index.js`]
        },
        'commodities': {
            style: `${PATH.STYLES}/commodities.styl`,
            script: [`${PATH.SCRIPTS}/commodities.js`]
        },
        'commodity_detail': {
            style: `${PATH.STYLES}/commodity_detail.styl`,
            script: [`${PATH.SCRIPTS}/commodity_detail.js`]
        },
        'statistics': {
            style: `${PATH.STYLES}/statistics.styl`,
            script: []
        },

        // ---------------------------------------
        'login': {
            style: `${PATH.STYLES}/login.styl`,
            script: [`${PATH.SCRIPTS}/login.js`]
        },
        'bd_index': {
            style: `${PATH.STYLES}/bd_index.styl`,
            script: [`${PATH.SCRIPTS}/bd_index.js`]
        },
        'bd_menu_list': {
            style: `${PATH.STYLES}/bd_menu_list.styl`,
            script: [`${PATH.SCRIPTS}/bd_menu_list.js`]
        },
        'bd_comment_list': {
            style: `${PATH.STYLES}/bd_comment_list.styl`,
            script: [`${PATH.SCRIPTS}/bd_menu_list.js`]
        },
        'bd_menu_form': {
            style: `${PATH.STYLES}/bd_menu_form.styl`,
            script: [`${PATH.VENDORS}/selectize.min.js`, `${PATH.SCRIPTS}/bd_menu_form.js`]
        },
        'menu_list': {
            style: `${PATH.STYLES}/menu_list.styl`,
            script: [`${PATH.SCRIPTS}/menu_list.js`]
        },
        'menu_detail': {
            style: `${PATH.STYLES}/menu_detail.styl`,
            script: [`${PATH.SCRIPTS}/menu_detail.js`]
        },
        'map': {
            style: `${PATH.STYLES}/map.styl`,
            script: []
        },
        'basket': {
            style: `${PATH.STYLES}/basket.styl`,
            script: [`${PATH.SCRIPTS}/basket.js`]
        },
        'comment': {
            style: `${PATH.STYLES}/comment.styl`,
            script: [`${PATH.SCRIPTS}/comment.js`]
        }

    }
};